package com.uroad.jilinpda.webservice;


import com.uroad.jilinpda.util.AppUtils;

import java.util.HashMap;

/**
 * Created by admin(wlw) on 2018/8/9.
 * 测试环境：activate改为activatetest1
 */
public class ActivateWS extends BaseWS{


    /**
     * 3.8.1.	启动设备注册与更新（online）
     */
    public static String online = "/eaaspush/device/online";

    public static HashMap onlineParams(String osver,String phonemodel,
                                             String appver,String deviceuuid,String devicename) {
        HashMap params = new HashMap();
        params.put("os", "Android");
        params.put("osver", osver);
        params.put("phonemodel", phonemodel);
        params.put("channel", "ANDROID_APK");
        params.put("appver", appver);
        params.put("deviceuuid", deviceuuid);
        params.put("devicename", devicename);
        return params;
    }

    /**
     * 3.8.2.	APP退出（offline）
     */
    public static String offline = "/eaaspush/device/offline";

    public static HashMap offlineParams(String deviceuuid) {
        HashMap params = new HashMap();
        params.put("deviceuuid", deviceuuid);
        return params;
    }

    /**
     * 3.8.3.	获取APP最新版本信息(appVersion)
     */
    public static String appVersion = "/eaaspush/device/appVersion";

    public static HashMap appVersionParams(String deviceuuid,String channel) {
        HashMap params = new HashMap();
        params.put("deviceuuid", deviceuuid);
        params.put("channel", channel);
        return params;
    }

    /**
     * 3.8.4.	用户登录（login）
     */
    public static String login = "/eaaspush/device/login";

    public static HashMap loginParams(String loginname, String smscode, String deviceuuid) {
        HashMap params = new HashMap();
        params.put("loginname", loginname);
        params.put("smscode", smscode);
        params.put("deviceuuid", deviceuuid);
        return params;
    }

    /**
     * 3.8.4.	用户登录（login）
     */
    public static String sendCode = "/eaaspush/sms/send";

    public static HashMap sendCode(String phone,String deviceuuid) {
        HashMap params = new HashMap();
        params.put("phone",phone);
        params.put("deviceuuid",deviceuuid);
        return params;
    }

    /**
     * 3.8.5.	用户退出（logout）
     */
    public static String logout = "/eaaspush/device/logout";

    public static HashMap logoutParams(String ticketid,String deviceuuid) {
        HashMap params = new HashMap();
        params.put("ticketid", ticketid);
        params.put("deviceuuid", deviceuuid);
        return params;
    }

    /**
     * 3.2.1.	根据手机号或车牌与手机号查询用户待激活订单（fetchActivates）
     */
    public static String fetchActivates = AppUtils.isDebug() ? "/eaaspush/activatenewtest/fetchActivates":"/eaaspush/activatenew/fetchActivates";

    public static HashMap fetchActivatesParams(String numberplate,String phone) {
        HashMap params = new HashMap();
        params.put("numberplate", numberplate);
        params.put("phone", phone);
        return params;
    }

    /**
     * 3.2.2.	上传激活所需两张图片（uploadImage）
     */
    public static String uploadImage1 = AppUtils.isDebug()?"/eaaspush/activatenewtest/uploadImage1":"/eaaspush/activatenew/uploadImage1";

    public static HashMap uploadImage1Params(String orderno, String obuimg) {
        HashMap params = new HashMap();
        params.put("orderno", orderno);
        params.put("obuimg", obuimg);
        return params;
    }

    /**
     * 3.2.1.	校验是否可激活
     */
    public static String canActivate = AppUtils.isDebug()?"/eaaspush/activatenewtest/canActivate":"/eaaspush/activatenew/canActivate";

    public static HashMap canActivateParams(String ticketid, String orderno, String cardno, String obuno) {
        HashMap params = new HashMap();
        params.put("ticketid", ticketid);
        params.put("orderno", orderno);
        params.put("cardno", cardno);
        params.put("obuno", obuno);
        return params;
    }

    /**
     * 3.2.2.	蓝牙标签发行国密握手（authgm）
     */
    public static String authgm = AppUtils.isDebug()?"/eaaspush/activatenewtest/authgm":"/eaaspush/activatenew/authgm";

    public static HashMap authgmParams(String orderno, String deviceno, String seno,
                                             String random1,String signdata,String filevehicle,
                                             String filesystem,String file0016,String file0015) {
        HashMap params = new HashMap();
        params.put("orderno", orderno);
        params.put("deviceno", deviceno);
        params.put("seno", seno);
        params.put("random1", random1);
        params.put("signdata", signdata);
        params.put("filevehicle", filevehicle);
        params.put("filesystem", filesystem);
        params.put("file0016", file0016);
        params.put("file0015", file0015);
        return params;
    }

    //国密
    /**
     * 3.2.3.	国密标签二发更新车辆信息文件（gmModifyVehicle）
     */
    public static String gmModifyVehicle = "/eaaspush/activatenew/gmModifyVehicle";

    public static HashMap gmModifyVehicleParams(String sessionid, String instructionresps,
                                                      String instructionrespsmac) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("instructionresps", instructionresps);
        params.put("instructionrespsmac", instructionrespsmac);
        return params;
    }

    /**
     * 3.2.4.	国密标签二发更新系统信息文件（gmModifySystem）
     */
    public static String gmModifySystem = "/eaaspush/activatenew/gmModifySystem";

    public static HashMap gmModifySystemParams( String sessionid,String instructionresps,
                                                      String instructionrespsmac) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("instructionresps", instructionresps);
        params.put("instructionrespsmac", instructionrespsmac);
        return params;
    }

    /**
     * 3.2.5.	国密卡片二发0016文件更新（gmModify0016）
     */
    public static String gmModify0016 = "/eaaspush/activatenew/gmModify0016";

    public static HashMap gmModify0016Params(String sessionid,String random,String instructionresps,
                                                   String instructionrespsmac) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("random", random);
        params.put("instructionresps", instructionresps);
        params.put("instructionrespsmac", instructionrespsmac);
        return params;
    }
    /**
     * 3.2.6.	国密卡片二发0015文件更新（gmModify0015）
     */
    public static String gmModify0015 = "/eaaspush/activatenew/gmModify0015";

    public static HashMap gmModify0015Params(String sessionid,String instructionresps,
                                                   String instructionrespsmac) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("instructionresps", instructionresps);
        params.put("instructionrespsmac", instructionrespsmac);
        return params;
    }

    /**
     * 3.2.7.	国密发行结束（gmIssueEnd）
     */
    public static String gmIssueEnd = "/eaaspush/activatenew/gmIssueEnd";

    public static HashMap gmIssueEndParams(String sessionid,String instructionresps,
                                                 String instructionrespsmac) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("instructionresps", instructionresps);
        params.put("instructionrespsmac", instructionrespsmac);
        return params;
    }

    //明文
    /**
     * 3.2.8.	明文标签二发更新车辆信息文件（modifyVehicle）
     */
//    public static String modifyVehicle = getNewUrl("/eaaspush/activatenew/modifyVehicle");
    //测试环境
    public static String modifyVehicle = AppUtils.isDebug()?"/eaaspush/activatenewtest/modifyVehicle":"/eaaspush/activatenew/modifyVehicle";

    public static HashMap modifyVehicleParams(String orderno, String random, String filevehicle,
                                                    String filesystem,String file0016,String file0015,
                                                    String deviceno,String deviceuuid,String ticketid) {
        HashMap params = new HashMap();
        params.put("orderno", orderno);
        params.put("random", random);
        params.put("filevehicle", filevehicle);
        params.put("filesystem", filesystem);
        params.put("file0016", file0016);
        params.put("file0015", file0015);
        params.put("deviceno", deviceno);
        params.put("deviceuuid", deviceuuid);
        params.put("ticketid", ticketid);
        params.put("platform", "10501");//10501快递，10502iOSAPP，10503安卓APP，10504微信小程序，10505微信公众号，10506支付宝小程序
        return params;
    }

    /**
     * 3.2.9.	明文标签二发更新系统信息文件（modifySystem）
     */
    public static String modifySystem = AppUtils.isDebug()?"/eaaspush/activatenewtest/modifySystem":"/eaaspush/activatenew/modifySystem";

    public static HashMap modifySystemParams(String sessionid, String instructionresps) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("instructionresps", instructionresps);
        return params;
    }

    /**
     * 3.2.10.	明文卡片二发0016文件更新（modify0016）
     */
    public static String modify0016 = AppUtils.isDebug()?"/eaaspush/activatenewtest/modify0016":"/eaaspush/activatenew/modify0016";

    public static HashMap modify0016Params(String sessionid, String random, String instructionresps) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("random", random);
        params.put("instructionresps", instructionresps);
        return params;
    }

    /**
     * 3.2.11.	明文卡片二发0015文件更新（modify0015）
     */
    public static String modify0015 = (AppUtils.isDebug()?"/eaaspush/activatenewtest/modify0015":"/eaaspush/activatenew/modify0015");

    public static HashMap modify0015Params(String sessionid, String instructionresps) {
        HashMap params = new HashMap();
        params.put("sessionid", sessionid);
        params.put("instructionresps", instructionresps);
        return params;
    }

    /**
     * 3.2.12.	明文发行结束（issueEnd）
     */
    public static String issueEnd = (AppUtils.isDebug()?"/eaaspush/activatenewtest/issueEnd":"/eaaspush/activatenew/issueEnd");

    public static HashMap issueEndParams(String ticketid,String sessionid,String instructionresps, String filevehicle,
                                               String filesystem,String file0016, String file0015,String random) {
        HashMap params = new HashMap();
        params.put("ticketid", ticketid);
        params.put("sessionid", sessionid);
        params.put("instructionresps", instructionresps);
        params.put("file0016", file0016);
        params.put("file0015", file0015);
        params.put("random", random);
        params.put("filevehicle", filevehicle);
        params.put("filesystem", filesystem);
        return params;
    }

    /**
     * 3.2.16.	密文解密（decodeinstructions）
     */
    public static String decodeinstructions = "/eaaspush/activatenew/decodeinstructions";

    public static HashMap decodeinstructionsParams(String obuno,String filevehicle,String filesystem,String random) {
        HashMap params = new HashMap();
        params.put("deviceno", obuno);
        params.put("filevehicle", filevehicle);
        params.put("filesystem", filesystem);
        params.put("random", random);
        return params;
    }
}
